package com.dmall.array;

import java.util.Random;

/**
 * 动态数组测试类
 * @author xiao1.wang@dmall.com
 * @date 2019-03-21 18:40:03
 */
public class Main {

    public static void main(String[] args) {
        Array<Integer> arr = new Array<Integer>(20);
        for (int i = 0; i < 10; i++) {
            arr.addLast(i);
        }
        System.out.println(arr);

        Random random = new Random();

        for (int i = 0; i < 10; i++) {
            arr.removeLast();
            arr.removeLast();
            arr.addFirst(random.nextInt(20));
            System.out.println(arr);
        }
    }
}
